package sseGameApps.meta.mdkbr;

//@javax.annotation.Generated(value = { "slim3-gen", "@VERSION@" }, date = "2013-09-28 20:36:50")
/** */
public final class MdDecorationMeta extends org.slim3.datastore.ModelMeta<sseGameApps.model.mdkbr.MdDecoration> {

    /** */
    public final org.slim3.datastore.CoreAttributeMeta<sseGameApps.model.mdkbr.MdDecoration, java.util.Date> eventCompDate1 = new org.slim3.datastore.CoreAttributeMeta<sseGameApps.model.mdkbr.MdDecoration, java.util.Date>(this, "eventCompDate1", "eventCompDate1", java.util.Date.class);

    /** */
    public final org.slim3.datastore.CoreAttributeMeta<sseGameApps.model.mdkbr.MdDecoration, java.util.Date> eventCompDate2 = new org.slim3.datastore.CoreAttributeMeta<sseGameApps.model.mdkbr.MdDecoration, java.util.Date>(this, "eventCompDate2", "eventCompDate2", java.util.Date.class);

    /** */
    public final org.slim3.datastore.CoreAttributeMeta<sseGameApps.model.mdkbr.MdDecoration, java.util.Date> eventCompDate3 = new org.slim3.datastore.CoreAttributeMeta<sseGameApps.model.mdkbr.MdDecoration, java.util.Date>(this, "eventCompDate3", "eventCompDate3", java.util.Date.class);

    /** */
    public final org.slim3.datastore.CoreAttributeMeta<sseGameApps.model.mdkbr.MdDecoration, java.util.Date> eventCompDate4 = new org.slim3.datastore.CoreAttributeMeta<sseGameApps.model.mdkbr.MdDecoration, java.util.Date>(this, "eventCompDate4", "eventCompDate4", java.util.Date.class);

    /** */
    public final org.slim3.datastore.CoreAttributeMeta<sseGameApps.model.mdkbr.MdDecoration, java.util.Date> eventCompDate5 = new org.slim3.datastore.CoreAttributeMeta<sseGameApps.model.mdkbr.MdDecoration, java.util.Date>(this, "eventCompDate5", "eventCompDate5", java.util.Date.class);

    /** */
    public final org.slim3.datastore.CoreAttributeMeta<sseGameApps.model.mdkbr.MdDecoration, java.lang.Boolean> eventComplete1 = new org.slim3.datastore.CoreAttributeMeta<sseGameApps.model.mdkbr.MdDecoration, java.lang.Boolean>(this, "eventComplete1", "eventComplete1", boolean.class);

    /** */
    public final org.slim3.datastore.CoreAttributeMeta<sseGameApps.model.mdkbr.MdDecoration, java.lang.Boolean> eventComplete2 = new org.slim3.datastore.CoreAttributeMeta<sseGameApps.model.mdkbr.MdDecoration, java.lang.Boolean>(this, "eventComplete2", "eventComplete2", boolean.class);

    /** */
    public final org.slim3.datastore.CoreAttributeMeta<sseGameApps.model.mdkbr.MdDecoration, java.lang.Boolean> eventComplete3 = new org.slim3.datastore.CoreAttributeMeta<sseGameApps.model.mdkbr.MdDecoration, java.lang.Boolean>(this, "eventComplete3", "eventComplete3", boolean.class);

    /** */
    public final org.slim3.datastore.CoreAttributeMeta<sseGameApps.model.mdkbr.MdDecoration, java.lang.Boolean> eventComplete4 = new org.slim3.datastore.CoreAttributeMeta<sseGameApps.model.mdkbr.MdDecoration, java.lang.Boolean>(this, "eventComplete4", "eventComplete4", boolean.class);

    /** */
    public final org.slim3.datastore.CoreAttributeMeta<sseGameApps.model.mdkbr.MdDecoration, java.lang.Boolean> eventComplete5 = new org.slim3.datastore.CoreAttributeMeta<sseGameApps.model.mdkbr.MdDecoration, java.lang.Boolean>(this, "eventComplete5", "eventComplete5", boolean.class);

    /** */
    public final org.slim3.datastore.CoreAttributeMeta<sseGameApps.model.mdkbr.MdDecoration, com.google.appengine.api.datastore.Key> key = new org.slim3.datastore.CoreAttributeMeta<sseGameApps.model.mdkbr.MdDecoration, com.google.appengine.api.datastore.Key>(this, "__key__", "key", com.google.appengine.api.datastore.Key.class);

    /** */
    public final org.slim3.datastore.CoreAttributeMeta<sseGameApps.model.mdkbr.MdDecoration, java.util.Date> updatedAt = new org.slim3.datastore.CoreAttributeMeta<sseGameApps.model.mdkbr.MdDecoration, java.util.Date>(this, "updatedAt", "updatedAt", java.util.Date.class);

    /** */
    public final org.slim3.datastore.StringAttributeMeta<sseGameApps.model.mdkbr.MdDecoration> userId = new org.slim3.datastore.StringAttributeMeta<sseGameApps.model.mdkbr.MdDecoration>(this, "userId", "userId");

    /** */
    public final org.slim3.datastore.CoreAttributeMeta<sseGameApps.model.mdkbr.MdDecoration, java.lang.Long> version = new org.slim3.datastore.CoreAttributeMeta<sseGameApps.model.mdkbr.MdDecoration, java.lang.Long>(this, "version", "version", java.lang.Long.class);

    private static final org.slim3.datastore.ModificationDate slim3_updatedAtAttributeListener = new org.slim3.datastore.ModificationDate();

    private static final MdDecorationMeta slim3_singleton = new MdDecorationMeta();

    /**
     * @return the singleton
     */
    public static MdDecorationMeta get() {
       return slim3_singleton;
    }

    /** */
    public MdDecorationMeta() {
        super("MdDecoration", sseGameApps.model.mdkbr.MdDecoration.class);
    }

    @Override
    public sseGameApps.model.mdkbr.MdDecoration entityToModel(com.google.appengine.api.datastore.Entity entity) {
        sseGameApps.model.mdkbr.MdDecoration model = new sseGameApps.model.mdkbr.MdDecoration();
        model.setEventCompDate1((java.util.Date) entity.getProperty("eventCompDate1"));
        model.setEventCompDate2((java.util.Date) entity.getProperty("eventCompDate2"));
        model.setEventCompDate3((java.util.Date) entity.getProperty("eventCompDate3"));
        model.setEventCompDate4((java.util.Date) entity.getProperty("eventCompDate4"));
        model.setEventCompDate5((java.util.Date) entity.getProperty("eventCompDate5"));
        model.setEventComplete1(booleanToPrimitiveBoolean((java.lang.Boolean) entity.getProperty("eventComplete1")));
        model.setEventComplete2(booleanToPrimitiveBoolean((java.lang.Boolean) entity.getProperty("eventComplete2")));
        model.setEventComplete3(booleanToPrimitiveBoolean((java.lang.Boolean) entity.getProperty("eventComplete3")));
        model.setEventComplete4(booleanToPrimitiveBoolean((java.lang.Boolean) entity.getProperty("eventComplete4")));
        model.setEventComplete5(booleanToPrimitiveBoolean((java.lang.Boolean) entity.getProperty("eventComplete5")));
        model.setKey(entity.getKey());
        model.setUpdatedAt((java.util.Date) entity.getProperty("updatedAt"));
        model.setUserId((java.lang.String) entity.getProperty("userId"));
        model.setVersion((java.lang.Long) entity.getProperty("version"));
        return model;
    }

    @Override
    public com.google.appengine.api.datastore.Entity modelToEntity(java.lang.Object model) {
        sseGameApps.model.mdkbr.MdDecoration m = (sseGameApps.model.mdkbr.MdDecoration) model;
        com.google.appengine.api.datastore.Entity entity = null;
        if (m.getKey() != null) {
            entity = new com.google.appengine.api.datastore.Entity(m.getKey());
        } else {
            entity = new com.google.appengine.api.datastore.Entity(kind);
        }
        entity.setProperty("eventCompDate1", m.getEventCompDate1());
        entity.setProperty("eventCompDate2", m.getEventCompDate2());
        entity.setProperty("eventCompDate3", m.getEventCompDate3());
        entity.setProperty("eventCompDate4", m.getEventCompDate4());
        entity.setProperty("eventCompDate5", m.getEventCompDate5());
        entity.setProperty("eventComplete1", m.isEventComplete1());
        entity.setProperty("eventComplete2", m.isEventComplete2());
        entity.setProperty("eventComplete3", m.isEventComplete3());
        entity.setProperty("eventComplete4", m.isEventComplete4());
        entity.setProperty("eventComplete5", m.isEventComplete5());
        entity.setProperty("updatedAt", m.getUpdatedAt());
        entity.setProperty("userId", m.getUserId());
        entity.setProperty("version", m.getVersion());
        entity.setProperty("slim3.schemaVersion", 1);
        return entity;
    }

    @Override
    protected com.google.appengine.api.datastore.Key getKey(Object model) {
        sseGameApps.model.mdkbr.MdDecoration m = (sseGameApps.model.mdkbr.MdDecoration) model;
        return m.getKey();
    }

    @Override
    protected void setKey(Object model, com.google.appengine.api.datastore.Key key) {
        validateKey(key);
        sseGameApps.model.mdkbr.MdDecoration m = (sseGameApps.model.mdkbr.MdDecoration) model;
        m.setKey(key);
    }

    @Override
    protected long getVersion(Object model) {
        sseGameApps.model.mdkbr.MdDecoration m = (sseGameApps.model.mdkbr.MdDecoration) model;
        return m.getVersion() != null ? m.getVersion().longValue() : 0L;
    }

    @Override
    protected void assignKeyToModelRefIfNecessary(com.google.appengine.api.datastore.AsyncDatastoreService ds, java.lang.Object model) {
    }

    @Override
    protected void incrementVersion(Object model) {
        sseGameApps.model.mdkbr.MdDecoration m = (sseGameApps.model.mdkbr.MdDecoration) model;
        long version = m.getVersion() != null ? m.getVersion().longValue() : 0L;
        m.setVersion(Long.valueOf(version + 1L));
    }

    @Override
    protected void prePut(Object model) {
        sseGameApps.model.mdkbr.MdDecoration m = (sseGameApps.model.mdkbr.MdDecoration) model;
        m.setUpdatedAt(slim3_updatedAtAttributeListener.prePut(m.getUpdatedAt()));
    }

    @Override
    protected void postGet(Object model) {
    }

    @Override
    public String getSchemaVersionName() {
        return "slim3.schemaVersion";
    }

    @Override
    public String getClassHierarchyListName() {
        return "slim3.classHierarchyList";
    }

    @Override
    protected boolean isCipherProperty(String propertyName) {
        return false;
    }

    @Override
    protected void modelToJson(org.slim3.datastore.json.JsonWriter writer, java.lang.Object model, int maxDepth, int currentDepth) {
        sseGameApps.model.mdkbr.MdDecoration m = (sseGameApps.model.mdkbr.MdDecoration) model;
        writer.beginObject();
        org.slim3.datastore.json.Default encoder0 = new org.slim3.datastore.json.Default();
        if(m.getEventCompDate1() != null){
            writer.setNextPropertyName("eventCompDate1");
            encoder0.encode(writer, m.getEventCompDate1());
        }
        if(m.getEventCompDate2() != null){
            writer.setNextPropertyName("eventCompDate2");
            encoder0.encode(writer, m.getEventCompDate2());
        }
        if(m.getEventCompDate3() != null){
            writer.setNextPropertyName("eventCompDate3");
            encoder0.encode(writer, m.getEventCompDate3());
        }
        if(m.getEventCompDate4() != null){
            writer.setNextPropertyName("eventCompDate4");
            encoder0.encode(writer, m.getEventCompDate4());
        }
        if(m.getEventCompDate5() != null){
            writer.setNextPropertyName("eventCompDate5");
            encoder0.encode(writer, m.getEventCompDate5());
        }
        writer.setNextPropertyName("eventComplete1");
        encoder0.encode(writer, m.isEventComplete1());
        writer.setNextPropertyName("eventComplete2");
        encoder0.encode(writer, m.isEventComplete2());
        writer.setNextPropertyName("eventComplete3");
        encoder0.encode(writer, m.isEventComplete3());
        writer.setNextPropertyName("eventComplete4");
        encoder0.encode(writer, m.isEventComplete4());
        writer.setNextPropertyName("eventComplete5");
        encoder0.encode(writer, m.isEventComplete5());
        if(m.getKey() != null){
            writer.setNextPropertyName("key");
            encoder0.encode(writer, m.getKey());
        }
        if(m.getUpdatedAt() != null){
            writer.setNextPropertyName("updatedAt");
            encoder0.encode(writer, m.getUpdatedAt());
        }
        if(m.getUserId() != null){
            writer.setNextPropertyName("userId");
            encoder0.encode(writer, m.getUserId());
        }
        if(m.getVersion() != null){
            writer.setNextPropertyName("version");
            encoder0.encode(writer, m.getVersion());
        }
        writer.endObject();
    }

    @Override
    protected sseGameApps.model.mdkbr.MdDecoration jsonToModel(org.slim3.datastore.json.JsonRootReader rootReader, int maxDepth, int currentDepth) {
        sseGameApps.model.mdkbr.MdDecoration m = new sseGameApps.model.mdkbr.MdDecoration();
        org.slim3.datastore.json.JsonReader reader = null;
        org.slim3.datastore.json.Default decoder0 = new org.slim3.datastore.json.Default();
        reader = rootReader.newObjectReader("eventCompDate1");
        m.setEventCompDate1(decoder0.decode(reader, m.getEventCompDate1()));
        reader = rootReader.newObjectReader("eventCompDate2");
        m.setEventCompDate2(decoder0.decode(reader, m.getEventCompDate2()));
        reader = rootReader.newObjectReader("eventCompDate3");
        m.setEventCompDate3(decoder0.decode(reader, m.getEventCompDate3()));
        reader = rootReader.newObjectReader("eventCompDate4");
        m.setEventCompDate4(decoder0.decode(reader, m.getEventCompDate4()));
        reader = rootReader.newObjectReader("eventCompDate5");
        m.setEventCompDate5(decoder0.decode(reader, m.getEventCompDate5()));
        reader = rootReader.newObjectReader("eventComplete1");
        m.setEventComplete1(decoder0.decode(reader, m.isEventComplete1()));
        reader = rootReader.newObjectReader("eventComplete2");
        m.setEventComplete2(decoder0.decode(reader, m.isEventComplete2()));
        reader = rootReader.newObjectReader("eventComplete3");
        m.setEventComplete3(decoder0.decode(reader, m.isEventComplete3()));
        reader = rootReader.newObjectReader("eventComplete4");
        m.setEventComplete4(decoder0.decode(reader, m.isEventComplete4()));
        reader = rootReader.newObjectReader("eventComplete5");
        m.setEventComplete5(decoder0.decode(reader, m.isEventComplete5()));
        reader = rootReader.newObjectReader("key");
        m.setKey(decoder0.decode(reader, m.getKey()));
        reader = rootReader.newObjectReader("updatedAt");
        m.setUpdatedAt(decoder0.decode(reader, m.getUpdatedAt()));
        reader = rootReader.newObjectReader("userId");
        m.setUserId(decoder0.decode(reader, m.getUserId()));
        reader = rootReader.newObjectReader("version");
        m.setVersion(decoder0.decode(reader, m.getVersion()));
        return m;
    }
}